###out:src/main/resources/mapper/${root.beanName}Mapper.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${config.packageName}.dao.mybatis.${root.beanName}Mapper">
    <!-- 请勿修改！请在自定义区写自定义SQL -->
    <resultMap id="BaseResultMap" type="${config.packageName}.entity.${root.beanName}" >
    <#list root.tableColumns as column>
    <#if column.primaryKey>
        <id column="${column.columnName}" property="${column.propertyName}" jdbcType="${column.jdbcType}" /><!-- ${column.columnComment} -->
    <#else>
        <result column="${column.columnName}" property="${column.propertyName}" jdbcType="${column.jdbcType}" /><!-- ${column.columnComment} -->
    </#if>
    </#list >
    </resultMap>
    <!-- 获取 -->
    <select id="get" resultMap="BaseResultMap" parameterType="${root.primaryKeyColumn.propertyFullType}" >
        select * from ${root.tableName}
        where ${root.primaryKeyColumn.columnName} = ${r'#{id,jdbcType=VARCHAR}'}  and activate = true
    </select>
    <!-- ******************************Start 自定义区 ****************************** -->
    <!-- 通过搜索条件对象查询 -->
    <select id="selectBy${root.beanName}SearchForm" resultMap="BaseResultMap" parameterType="${config.packageName}.form.${root.beanName}SearchForm">
        select * from ${root.tableName}
        where 1 = 1
        <if test="page != null and pageSize != null">
            limit ${r'#{pageIndex}'} , ${r'#{pageSize}'}
        </if>
    </select>
    <!-- 通过搜索条件查询记录数 -->
    <select id="countBy${root.beanName}SearchForm" resultType="java.lang.Long" parameterType="${config.packageName}.form.${root.beanName}SearchForm">
        select count(*) from ${root.tableName}
        where 1 = 1
    </select>
    <!-- ******************************End 自定义区 ****************************** -->
</mapper>